import java.util.*;

public class Main {
    public static void main(String[] args) {
        MultiLanguage op = new MultiLanguage();
        op.output("st");
        ArrayList<IntegerExpression> exp = new ArrayList<IntegerExpression>();
        ArrayList<FractionExpression> expF = new ArrayList<FractionExpression>();
        ArrayList<Calculate> cal = new ArrayList<Calculate>();
        Scanner sc = new Scanner(System.in);
        int  error_case = 0;
        Integer ansI;
        Fraction ansF;
        String ip[];
        for (int i = 0; i <= 2; i++) {
            System.out.printf("Case #%d\n", i);
            exp.add(new IntegerExpression((int) (Math.random() * 5 + 2)));
            cal.add(new Calculate(exp.get(i)));
            System.out.println(exp.get(i));
            ansI = Integer.parseInt(sc.nextLine());
            if(ansI.equals(cal.get(i).getValue()))op.output("acc");
            else {
                op.output("err");
                op.output("ans");
                System.out.printf("%d   ",ansI);
                op.output("key");
                System.out.printf("%d\n",cal.get(i).getValue());
                error_case += 1;
            }
        }
        for(int i = 3;i<=4;i++){
            System.out.printf("Case #%d\n", i);
            expF.add(new FractionExpression());
            System.out.println(expF.get(i-3));
            ip = sc.nextLine().split("/");
            if(ip.length==2)ansF = new Fraction(Integer.parseInt(ip[0]),Integer.parseInt(ip[1]));
            else ansF = new Fraction(Integer.parseInt(ip[0]),1);
            if(ansF.toString().equals(expF.get(i-3).getValue().toString()))op.output("acc");
            else {
                op.output("err");
                op.output("ans");
                System.out.print(ansF+"   ");
                op.output("key");
                System.out.print(expF.get(i-3).getValue()+"\n");
                error_case += 1;
            }
        }
        op.output("accuracy");   System.out.print(100 - error_case * 20 +"%");

    }
}
